#include <iostream>
#include <sstream>
#include <string>
using namespace std;

class Able
{
private:
    int mydata;
public:
    Able(int x){mydata = x;}
    void print(ostream& os) const{
        os << mydata;
    }
    int toInt() const {
        return mydata;
    }
    string toString() const{
        ostringstream os;
        os<< mydata;
        return os.str();
    } 
};

template <class Printable>
void testPrintable(const Printable& p){
    p.print(cout);
    cout<<endl;
 }

 template <class Intable>
 void testIntable(const Intable& n){
     cout<< n.toInt()+1 <<endl;
 }

 template <class Stringable>
 void testStringable(const Stringable& s){
     cout << s.toString()+"th"<<endl;
 }

 int main(){
    Able a(7);
    testPrintable(a);
    testIntable(a);
    testStringable(a);
    return 0;
 }


